namespace IAM.Interface.Model
{
    using IAM.Interface.Model.Interface;
    using System;
    using System.Text;

    public class OrganizeInfo : AbstractConvertObject, IConvertXml
    {
        private AccountInfo _director;
        private IAM.Interface.Model.OrganizeBaseInfo _organizebaseinfo;

        public override object ConvertToObject()
        {
            this.OrganizeBaseInfo = new IAM.Interface.Model.OrganizeBaseInfo();
            this.OrganizeBaseInfo.CurrentXmlNode = this.CurrentXmlNode;
            this.OrganizeBaseInfo = (IAM.Interface.Model.OrganizeBaseInfo) this.OrganizeBaseInfo.ConvertToObject();
            this.Director = new AccountInfo();
            this.Director.CurrentXmlNode = this.CurrentXmlNode.SelectSingleNode("Director/AccountInfo");
            this.Director = (AccountInfo) this.Director.ConvertToObject();
            return this;
        }

        public AccountInfo Director
        {
            get
            {
                return this._director;
            }
            set
            {
                this._director = value;
            }
        }

        public IAM.Interface.Model.OrganizeBaseInfo OrganizeBaseInfo
        {
            get
            {
                return this._organizebaseinfo;
            }
            set
            {
                this._organizebaseinfo = value;
            }
        }

        public string XML
        {
            get
            {
                return (this.XMLBoday + this.XMLFinis);
            }
        }

        public string XMLBoday
        {
            get
            {
                StringBuilder _xml = new StringBuilder();
                _xml.Append(this.OrganizeBaseInfo.XML);
                _xml.Append("<Director>");
                _xml.Append(this.Director.XML);
                _xml.Append("</Director>");
                return _xml.ToString();
            }
        }

        public string XMLFinis
        {
            get
            {
                return "";
            }
        }
    }
}
